package com.itheima.demo5;

import java.io.*;
import java.nio.charset.Charset;

public class IODemo12 {
    public static void main(String[] args) throws IOException {
     /*   FileReader fw = new FileReader("a.txt", Charset.forName("GBK"));
        FileWriter gbk = new FileWriter("b.txt", Charset.forName("UTF-8"));

        int b;
        while ((b = fw.read()) != -1){
            gbk.write(b);
        }

        fw.close();
        gbk.close();*/

        BufferedReader br = new BufferedReader(new FileReader("copy.txt"));
        String line;
        while ((line = br.readLine()) != null){
            System.out.println(line);
        }
        br.close();

    }
}
